package com.hcmu.networklibs.rss;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;




/**
 * This class handle rss xml 
 * */
public class RSSFeed {
	// xml nodes
    public String title;
    public String description;
    public String link;
    public String language;
    public String generator;
    public String copyright;
    public String imageUrl;
    public String imageTitle;
    public String imageLink;
    public String content;

    private ArrayList<RSSItem> items;
    private HashMap<String, ArrayList<RSSItem>> category;

    public void addItem(RSSItem item) {
        if (this.items == null)
            this.items = new ArrayList<RSSItem>();
        this.items.add(item);
    }

    public void addItem(String category, RSSItem item) {
        if (this.category == null)
            this.category = new HashMap<String, ArrayList<RSSItem>>();
        if (!this.category.containsKey(category))
            this.category.put(category, new ArrayList<RSSItem>());
        this.category.get(category).add(item);
    }

    public ArrayList<RSSItem> getItems() {
        return items;
    }

}
